import com.eshop.pojo.AdminInfo;
import com.eshop.service.AdminInfoService;
import com.eshop.service.Impl.AdminInfoServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@RunWith(value = SpringJUnit4ClassRunner.class)
public class test {
    @Autowired
    private AdminInfoService service;
    @Test
    public void test1(){
        AdminInfo adminInfo = new AdminInfo();
        adminInfo.setName("admin");
        adminInfo.setPwd("123456");
        AdminInfo admin = service.selectByNameAndPwd(adminInfo);
        if (null == admin){
            System.out.println("登录失败！");
        }else {
            System.out.println("登录成功！");
        }
    }
}
